home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
fs
/
efs_ino.h.z
/
efs_ino.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
4KB
|
108 lines
/**************************************************************************
* *
* Copyright (C) 1988, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
#ifndef __EFS_INO_
#define __EFS_INO_
#ident "$Revision: 3.11 $"
/*
* Definitions for the on-volume version of extent filesystem inodes.
* Inodes consist of some number of extents, as contained in
* di_numextents. When di_numextents exceeds EFS_DIRECTEXTENTS, then the
* extents are kept elsewhere. ``Elsewhere'' is defined as a list of up
* to EFS_DIRECTEXTENTS contiguous blocks of indirect extents. An
* indirect extent is an extent descriptor (bn,len) which points to the
* disk blocks holding the actual extents. For direct extents, the
* ex_offset field contains the logical offset into the file that the
* extent covers. For indirect extents the field
* di_u.di_extents[0].ex_offset contains the number of
* indirect extents.
*
* Valid extents are determined by their ex_bn, ex_length, ex_offset.
* If the ex_bn is zero, then the tuple (ex_length, ex_offset) determine
* a ``hole'' in the file - namely, a section of the file which was never
* written, and is assumed to contain zeros. If the ex_bn is non-zero, and
* if the ex_bn is less than fs_firstcg, or if the ex_bn is greater than or
* equal to the fs_size then the block # is out of range. If the ex_length
* is zero or if the ex_length is larger than EFS_MAXEXTENTLEN, then the
* extent is bad. If the (ex_offset, ex_length) tuple overlaps any other
* extent, then the extent is bad.
*/
/*
* Layout of an extent, in memory and on disk.
* This structure is laid out to take exactly 8 bytes.
*/
typedef struct extent {
unsigned int ex_magic:8, /* magic # (MUST BE ZERO) */
ex_bn:24, /* basic block # */
ex_length:8, /* length of this extent, in bb's */
ex_offset:24; /* logical bb offset into file */
} extent;
/* # of directly mappable extents (also in fact # of possible indirect
* extents since these live in the direct extent table).
*/
#define EFS_DIRECTEXTENTS 12
/* The inode code expects to be able to handle indirect extents in ONE
* buffer. So impose a limit on the size of an indirect extent.
* (Note this is a first minimum-change hack for long files. We'll
* probably remove the one-buffer restriction later, in which case
* EFS_MAXINDIRBBS can get larger).
*/
#define EFS_MAXINDIRBBS 32
/*
* Therefore follows as the night the day a computable number for the
* maximum number of extents possible for an inode...
*/
#define EFS_MAXEXTENTS ((EFS_DIRECTEXTENTS * EFS_MAXINDIRBBS * BBSIZE) \
/ sizeof (struct extent))
/* # of inodes per page */
#define EFS_INODESPERPAGE (NBPC / sizeof(struct efs_dinode))
/* maximum length of a single extent */
#define EFS_MAXEXTENTLEN (256 - 8)
/*
* Extent based filesystem inode as it appears on disk. The efs inode
* is exactly 128 bytes long.
*/
struct efs_dinode {
ushort di_mode; /* mode and type of file */
short di_nlink; /* number of links to file */
ushort di_uid; /* owner's user id */
ushort di_gid; /* owner's group id */
off_t di_size; /* number of bytes in file */
time_t di_atime; /* time last accessed */
time_t di_mtime; /* time last modified */
time_t di_ctime; /* time created */
ulong di_gen; /* generation number */
short di_numextents; /* # of extents */
ushort di_refs; /* refrence count since last reorg */
union di_addr {
extent di_extents[EFS_DIRECTEXTENTS];
dev_t di_dev; /* device for IFCHR/IFBLK */
} di_u;
};
/* sizeof (struct efs_dinode), log2 */
#define EFS_EFSINOSHIFT 7
#endif /* __EFS_INO_ */